package com.wswy.wyjk.utils;

import android.text.TextUtils;
import android.widget.Toast;
import com.wswy.wyjk.AppContext;

/**
 * Created by zl on 2017/12/6.
 */

public class ToastUtils {

  public static void showError(Throwable e){
    if (e != null){
      Toast.makeText(AppContext.getContext(),e.getMessage(),Toast.LENGTH_SHORT).show();
    }
  }

  public static void showText(CharSequence text){
    if (!TextUtils.isEmpty(text)){
      Toast.makeText(AppContext.getContext(),text,Toast.LENGTH_SHORT).show();
    }
  }
  public static void showText(int textId){
    Toast.makeText(AppContext.getContext(),AppContext.getContext().getString(textId),Toast.LENGTH_SHORT).show();
  }

}
